#include "tg_pagesettings.h"
#include "tg_document.h"

TgPageSettings::TgPageSettings(TgDocument *document) :
    m_document(document),
    m_pageOrientation(QPrinter::Portrait)
{
}

TgPageSettings::~TgPageSettings()
{
}

QRectF TgPageSettings::pageRect() const
{
    if( m_pageOrientation == QPrinter::Landscape )
    {
        return QRectF(0, 0, 11.69 * m_document->dpi(), 8.26 * m_document->dpi() );
    }
    return QRectF(0, 0, 8.26 * m_document->dpi(), 11.69 * m_document->dpi() );
}

void TgPageSettings::setPageOrientation(QPrinter::Orientation pageOrientation)
{
    if(m_pageOrientation != pageOrientation)
    {
        m_pageOrientation = pageOrientation;
    }
}
